﻿using System.ComponentModel;

namespace HouseKeepingPL.HKService
{
	partial class User : IDataErrorInfo
	{
		public string Error
		{
			get { return "Error Occured"; }
		}

		public string this[string columnName]
		{
			get
			{
				string result = null;
				if (columnName == "Username")
				{
					if (Username.Length < 3)
					{
						result = "Username must be more than 3 Chars";
					}
				}

				if (columnName == "Password")
				{
					if (Password.Length < 3)
					{
						result = "Password must be more than 3 Chars";
					}
				}

				//if (columnName == "Password")
				//{
				//    if (UserTypeId > 0)
				//    {
				//        result = "User type must be st";
				//    }
				//}

				return result;
			}
		}
	}
}